<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            width: 300px;
            height: 300px;
            
        }
        .absolutel{
            background-color: aquamarine;
            position: absolute;
            z-index: 1;
        }
        .relativel{
            background-color: antiquewhite;
            position: relative;
            margin-left: 10px;
            z-index: 2;
        }
    </style>
</head>
<body>
    
    <div class="absolutel">
        绝对定位
    </div>
    <br>
    <div class="relativel">相对定位</div>
</body>
</html>